package com.lory.controller;

import com.lory.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

@Controller
@RequestMapping("/user")
public class UserController {

    @RequestMapping("/list")
    public String list(Model model){
        List<User> users = new ArrayList<>();
        users.add(new User(5, "hongqigong", "1", "man"));
        users.add(new User(3, "yangguo", "2", "man"));
        users.add(new User(4, "xiaolongnv", "3", "women"));
        users.add(new User(2, "guojing", "4", "women"));
        users.add(new User(1, "guofurong", "5", "women"));
        model.addAttribute("userList", users);
        return "user-list";
    }
}
